package com.gzy.cbrsystem.shimian.action;

import java.util.List;

import com.gzy.cbrsystem.insomnia.InsomniaBasicInfo;
import com.gzy.cbrsystem.shimian.dao.CaseBasicInfo;
import com.gzy.cbrsystem.shimian.dao.ShimianBingzhen;
import com.gzy.cbrsystem.shimian.po.ShimianCase;
import com.gzy.cbrsystem.shimian.service.CaseReasoning;
import com.opensymphony.xwork2.ActionSupport;
public class SearchCaseAction extends ActionSupport{
	
	protected CaseReasoning caseReasoning;
	protected ShimianBingzhen shimianBingzhen;
	//protected CaseBasicInfo caseBasicInfo;
	protected List<InsomniaBasicInfo> insomniaBasicInfoList;
	protected String searchmean;
	protected String query;
	protected List searchResult;


	public List<InsomniaBasicInfo> getInsomniaBasicInfoList() {
		return insomniaBasicInfoList;
	}
	public void setInsomniaBasicInfoList(
			List<InsomniaBasicInfo> insomniaBasicInfoList) {
		this.insomniaBasicInfoList = insomniaBasicInfoList;
	}
	public List getSearchResult()
	{
		return this.searchResult;
	}
	public void setSearchResult(List searchResult)
	{
		this.searchResult=searchResult;
	}
	public String getSearchmean() {
		return searchmean;
	}
	public void setSearchmean(String searchmean) {
		this.searchmean = searchmean;
	}
	public String getQuery()
	{
		return this.query;
	}
	public void setQuery(String query)
	{
		this.query=query;
	}
	public void setShimianBingzhen(ShimianBingzhen shimianBingzhen) {
		this.shimianBingzhen = shimianBingzhen;
	}

	public ShimianBingzhen getShimianBingzhen() {
			return this.shimianBingzhen;
	}
	public void setCaseReasoning(CaseReasoning caseReasoning) {
		this.caseReasoning = caseReasoning;
	}

	public CaseReasoning getCaseReasoning() {
		return this.caseReasoning;
	}
	/*
	public void setCaseBasicInfo(CaseBasicInfo caseBasicInfo) {
		this.caseBasicInfo = caseBasicInfo;
	}
	public CaseBasicInfo getCaseBasicInfo() {
		return this.caseBasicInfo;
	}
	*/
	
	public String execute()throws Exception{
		/*
		List result=this.getCaseReasoning().search(this.getQuery());
		this.setSearchResult(result);
		*/
		if(getSearchmean().equals("caseId")){
			setInsomniaBasicInfoList((List<InsomniaBasicInfo>)getCaseReasoning().findCaseBasicInfoByID(query));
		}
		if(getSearchmean().equals("docName")){
			setInsomniaBasicInfoList((List<InsomniaBasicInfo>)this.getCaseReasoning().findCaseBasicInfoByDocName(query));
		}
		
		return SUCCESS;
		
	}
}
